package com.lianliankan.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

import android.content.Context;

import com.example.llkan.R;

public class ExtendMethod {
	private PlaySoundPool soundPool;
	public static String getMilliToDate(String time) {
		Date date = new Date(Long.valueOf(time));
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return formatter.format(date);
	}

	public void buttonClickSound(Context context) {
		
		soundPool = new PlaySoundPool(context);
		soundPool.loadSfx(R.raw.btnclick, 1);
		soundPool.play(1, 0);
		Timer timer = new Timer();
		timer.schedule(new TimerTask() {
			
			@Override
			public void run() {
				// TODO Auto-generated method stub
				soundPool.release();
			}
		}, 100);
		
	}
}
